#include<stdio.h>

int main(void)
{
	int a,b,c,d,e,v,s;
	
	scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
	
	s=a*c*2+b*c*2+a*b*2+d*(a-e-e)*8+d*(c-e-e)*8+d*(b-e-e)*8;
	v=a*b*c-d*(a-e-e)*(c-e-e)*2-d*(b-e-e)*(c-e-e)*2-d*(a-e-e)*(b-e-e)*2;
	
	printf("%d %d",s,v);
	
	return 0;
}
